<!-- $Id: category_list.htm 17019 2010-01-29 10:10:34Z liuhui $ -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>ECSHOP 管理中心 - 商品分类 </title>
<meta name="robots" content="noindex, nofollow">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="{{asset('admin/Styles/general.css')}}" rel="stylesheet" type="text/css" />
<link href="{{asset('admin/Styles/main.css')}}" rel="stylesheet" type="text/css" />
<script src="/admin/Js/jquery.js" type="text/javascript"></script>
</head>
<body>
<h1>
    <span class="action-span"><a href="{{url('manager/cateadd')}}">添加分类</a></span>
    <span class="action-span1"><a href="__GROUP__">ECSHOP 管理中心</a></span>
    <span id="search_id" class="action-span1"> - 栏目分类 </span>
    <div style="clear:both"></div>
</h1>
<form method="post" action="" name="listForm">
    <div class="list-div" id="listDiv">
        <table width="100%" cellspacing="1" cellpadding="2" id="list-table">
            <tr>
                <th>分类名称</th>
                <th>排序</th>
                <th>操作</th>
            </tr>
            
             @foreach($data as $k => $v)
            {{--<tr align="center" class="tr{{$v->cat_id}}">
                <td align="left" class="first-cellf">
                        @if($v->parent_id == 0)
                            <a onclick="toHidden(this)" href="javascript:void(0)">{{$v->cat_name}}</a>
                        @else
                            {{str_repeat('--------&nbsp;',$v->level)}}{{$v->cat_name}}
                        @endif
                <td width="15%" align="center"><span>{{$v->sort_order}}</span></td>
                <td width="30%" align="center">
                <a href="{{url('manager/idet',"$v->cat_id")}}">编辑</a> |
                <a href="{{url('manager/del',"$v->cat_id")}}" title="移除" onclick="">移除</a>
                </td>
            </tr>--}}
                @if($v->parent_id == 0)
                    <tr align="center" class="tr{{$v->cat_id}}">
                        <td align="left" class="first-cellf">
                            <a onclick="toHidden(this)" href="javascript:void(0)">{{$v->cat_name}}</a>
                        </td>
                        <td width="15%" align="center"><span></span></td>
                        <td width="30%" align="center">

                        </td>
                    </tr>
                    @foreach($data as $key =>$value)
                        @if($value->parent_id == $v->cat_id)
                            <tr align="center" class="atr{{$v->cat_id}}">
                                <td align="left" class="first-cellf">
                                    {{str_repeat('--------&nbsp;',$value->level)}}{{$value->cat_name}}
                                </td>
                                <td width="15%" align="center"><span>{{$value->sort_order}}</span></td>
                                <td width="30%" align="center">
                                    <a href="{{url('manager/idet',"$value->cat_id")}}">编辑</a> |
                                    <a href="{{url('manager/del',"$value->cat_id")}}" title="移除" onclick="">移除</a>
                                </td>
                            </tr>
                        @endif
                    @endforeach
                @endif

            @endforeach
        </table>
    </div>
    <script>
        var a = 1;
        function toHidden(obj){
            var tr = obj.parentNode.parentNode;
            var classname = $(tr).attr('class');
            if(a == 1) {
                a = 2;
                $('tr[class="a' + classname + '"]').hide();
            }else{
                a = 1;
                $('tr[class="a' + classname + '"]').show();
            }
        }
    </script>

</form>
</body>
</html>